// 该文件专门用于创建整个应用的路由器
import VueRouter from "vue-router";
//引入模块
import login from "@/pages/login";//登录页
import register from "@/pages/register";//注册账号
import user from "@/pages/user";//用户主页

//用户登录之后页
import admin from "@/pages/user/admin";
import apply from "@/pages/user/apply";
import authorize from "@/pages/user/authorize";
import company from "@/pages/user/company";
import personal from "@/pages/user/personal";
import repayment from "@/pages/user/repayment";
import loginNamePassword from "@/pages/login/loginNamePassword"
import loginFace from "@/pages/login/loginFace";
import information from "@/pages/information"
import safe from "@/pages/safe";
import face from "@/pages/face";

//其它界面
import about from "@/components/about";
import ApDownload from "@/components/ApDownload";
import Computer from "@/components/Computer";
import News from "@/components/News";
import Security from "@/components/Security";
import indexs from "@/components/indexs"

//主页
import Main from "@/components/indexs";

//计算器
import Center_1 from "@/pages/computer/Center_1";
import Center_2 from "@/pages/computer/Center_2";
import Center_3 from "@/pages/computer/Center_3";
import Center_4 from "@/pages/computer/Center_4";



const routes = [
    {
        path: '/',
        name: 'login',
        component:login,
    },
    {
        path: '/login',
        name: 'login',
        component:login,
        children: [
            {
                path: '/login/loginnamepassword',
                name: 'loginNamePassword',
                component: loginNamePassword
            },
            {
                path: '/login/loginface',
                name: 'loginFace',
                component: loginFace
            },
        ]
    },
    {
        path: '/register',
        name: 'register',
        component:register,
    },
    {
        path: '/about',
        name: 'about',
        component:about,
    },
    {
        path: '/apdownload',
        name: 'ApDownload',
        component:ApDownload,
    },
    {
        path: '/computer',
        name: 'Computer',
        component:Computer,
        children: [
            {
                path: '/computer/Center_1',
                name: 'Center_1',
                component:Center_1,
            },
            {
                path: '/computer/Center_2',
                name: 'Center_2',
                component:Center_2,
            },
            {
                path: '/computer/Center_3',
                name: 'Center_3',
                component:Center_3,
            },{
                path: '/computer/Center_4',
                name: 'Center_4',
                component:Center_4,
            },

        ]
    },
    {
        path: '/news',
        name: 'News',
        component:News,
    },{
        path: '/security',
        name: 'Security',
        component:Security,
    },{
        path: '/main',
        name: 'Main',
        component:Main,
    },
    {
        path: '/indexs',
        name: 'indexs',
        component:indexs,
    },
    {
        path: '/user',
        name: 'user',
        component:user,
        children: [
            // id需要动态传递参数，同this.$routes.params,搭配组件中 props:{id:{}}
            //模板
            //{path:'/categories/edit/:id',component:CategoryEdit,props:true},
            {
                path: '/user/information',
                name: 'information',
                component: information
            },{
                path: '/user/safe',
                name: 'safe',
                component: safe
            },
            {
                path: '/user/face',
                name: 'face',
                component: face
            },
            {
                path: '/user/admin',
                name: 'admin',
                component: admin
            },
            {
                path: '/user/authorize',
                name: 'authorize',
                component: authorize
            },
            {
                path: '/user/company',
                name: 'company',
                component: company
            },
            {
                path: '/user/personal',
                name: 'personal',
                component: personal
            },
            {
                path: '/user/repayment',
                name: 'repayment',
                component: repayment
            },
            {
                path: '/user/apply',
                name: 'apply',
                component: apply
            },


        ]
    },
]

//创建并暴露一个路由器
const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router